var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("BaseModuleUI"),
    a = e("monster_node_info"),
    i = e("node_team"),
    r = e("role_node"),
    s = e("team_node_info"),
    l = e("tower_node_info"),
    c = cc._decorator,
    d = c.ccclass,
    h =
        (c.property,
        (function (e) {
            function t() {
                var t = (null !== e && e.apply(this, arguments)) || this;
                return (t.role_info = null), (t.team_info = 0), t;
            }
            return (
                __extends(t, e),
                (t.prototype.initView = function () {
                    (this.role_info = this.node.parent.getComponent(r.default)),
                        (this.team_info = this.node.parent.getComponent(i.default).getTeamInfo());
                }),
                (t.prototype.onCollisionEnter = function (e, t) {
                    var o = e.node,
                        n = o.group;
                    if (1 == t.tag && 0 == e.tag)
                        if ("soldier" == n) {
                            var c = o.getComponent(s.default);
                            c.team_info != this.team_info &&
                                c.soldierBeHit(
                                    this.role_info.getRoleSkillAttack(t.tag),
                                    this.role_info.match_game_index
                                );
                        } else
                            "role" == n || "tower" == n
                                ? o.getComponent(i.default).getTeamInfo() != this.team_info &&
                                  ("role" == n
                                      ? o
                                            .getComponent(r.default)
                                            .roleBeHit(
                                                this.role_info.getRoleSkillAttack(t.tag),
                                                this.role_info.match_game_index
                                            )
                                      : "tower" == n &&
                                        o
                                            .getComponent(l.default)
                                            .towerBeHit(
                                                this.role_info.getRoleSkillAttack(t.tag),
                                                this.role_info.match_game_index
                                            ))
                                : "monster" == n &&
                                  o
                                      .getComponent(a.default)
                                      .attackMonster(
                                          this.role_info.getRoleSkillAttack(t.tag),
                                          this.role_info.match_game_index,
                                          this.node.parent
                                      );
                }),
                __decorate([d], t)
            );
        })(n.default));
o.default = h;
